'''
Created on 16/06/2009

@author: nick
'''
import unittest
from traindata import *


class Test(unittest.TestCase):
    def testDictionary(self):
        try:
            wordlist = traindata.getdictionary("analysis4_plain.txt")
        except IOError:
            assert(False)

    
    def testDictionaryError(self):
        try:
            wordlist = traindata.getdictionary("")
        except IOError:
            assert(True)

    def testTrainData(self):
        traindata.getdictionary("analysis4_plain.txt")
        data = traindata.gettraindata()
        print "\n"
        print data
        print "\n"
        assert(True)
        
    def testTestData(self):
        traindata.getdictionary("analysis4_plain.txt")
        training_data = traindata.gettraindata()
        testdata = traindata.gettestdata("analysis4_plain.txt")
        print "\n", testdata, "\n"
        assert(training_data == testdata)
                
if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()